package org.millioncall.yueyoga.admin.service;

import java.util.Map;

import org.millioncall.openplatform.common.PaginatedList;
import org.millioncall.yueyoga.admin.model.ProductRemaining;
import org.millioncall.yueyoga.admin.model.ProductUsedInfo;

public interface ProductRemainingService {
	public boolean updateProductRemaining(ProductRemaining pr);

	public ProductRemaining findProductRemainingById(int promainId);

	public boolean saveProductRemaining(ProductRemaining productRemaining);

	public boolean updateProductRemaining(Map<String, Object> map);

	public void deleteProductRemainingByMemberIds(Integer[] deids);

	public PaginatedList<ProductRemaining> getProductRemainingInPage(int start,
			int pageSize, Map<String, Object> map);

	public PaginatedList<ProductRemaining> findMemberProduct(int start,
			int limit, Map<String, Object> map);

	public int getCountsByMembetId(Map<String, Object> map);

	public void deleteProductRemainingByIds(Integer[] deids);

	public PaginatedList<ProductRemaining> findProductByMemberId(Integer start,
			Integer limit, Integer memberId);

	/**
	 * 查询会员产品的使用情况
	 * 
	 * @param start
	 * @param limit
	 * @param map
	 * @return
	 */
	public PaginatedList<ProductUsedInfo> findMemberProductsUsed(int start,
			int limit, Map<String, Object> map);

	/**
	 * 退款
	 * 
	 * @param proRemainIds
	 * @return
	 */
	public boolean refundProductsByIds(String proRemainIds);

	public boolean saveClearOrder(ProductRemaining pr);

	/**
	 * 查找所有可用剩余产品
	 * 
	 * @param map
	 *            参数集合
	 * @param start
	 *            第几页第一条
	 * @param limit
	 *            每页显示几条
	 * */
	public PaginatedList<ProductRemaining> findConsumptionProductRemaining(
			Map<String, Object> map, Integer start, Integer limit);

	public boolean deleteByIds(String Ids);
}
